import type DataSourceGroupType from "./data-source-group-type";


/**
 * 文本样式
 */
interface EchartTextStyleOption {
  fontFamily?: string;
  fontSize?: number;
  fontStyle?: string;
  fontWeight?: number;
  color?: string;
}

/**
 * 序列项样式
 */
interface EchartsSeriesItemStyleOption {
  color?: string;
  borderRadius?: number;
  borderColor?: string;
  borderWidth?: number;
  borderType?: string;
  borderDashOffset?: number;
  borderCap?: string;
  borderJoin?: string;
  borderMiterLimit?: number;
  shadowBlur?: number;
  shadowColor?: string;
  shadowOffsetX?: number;
  shadowOffsetY?: number;
  opacity?: number;
}

/**
 * 序列label
 */
interface EchartsSeriesLabelOption {
  show?: boolean;
  lineHeight?: number;
  width?: number;
  height?: number;
  padding?: Array<number> | number;
  color?: string;
  backgroundColor?: string;
  fontStyle?: string;
  fontWeight?: string;
  fontSize?: number;
  rotate?: {
    select: string;
    value: string
  };
  overflow?: string;
  ellipsis?: string;
  borderColor?: string;
  borderWidth?: number;
  borderType?: string;
  borderRadius?: number;
  position?: string;
  formatter?: string;
}

/**
 * 序列labelLine
 */
interface EchartsSeriesLabelLineOption {
  show?: boolean;
  showAbove?: boolean;
  length?: number;
  length2?: number;
  smooth?: boolean;
  minTurnAngle?: number;
  maxSurfaceAngle?: number;
  lineStyle?: {
    color?: string;
    width?: number;
    type?: string;
    opacity?: number;
  }
}


/**
 * 序列emphasis
 */
interface EchartsSeriesEmphasisOption {
  scale?: boolean;
  scaleSize?: number;
  focus?: string;
  blurScope?: string;
  label?: EchartsSeriesLabelOption;
  labelLine?: EchartsSeriesLabelLineOption;
}



/**
 * 序列数据
 */
interface EchartSeriesDataOption {
  value?: number;
  name?: string;
}

/**
 * 标题
 */
interface EchartTitleOption {
  show?: boolean;
  text?: string;
  textStyle?: EchartTextStyleOption;
  subtext?: string;
  subtextStyle?: EchartTextStyleOption;
}

/**
 * 提示框
 */
interface EchartTooltipOption {
  show?: boolean;
  trigger?: string;
  formatter?: string;
  triggerOn?: string;
}

/**
 * 提示框
 */
interface EchartLegendOption {
  type?: string; // 图例的类型 'plain':普通图例  'scroll':可滚动翻页的图例
  show?: boolean; //是否显示
  zlevel?: number; // 所有图形的 zlevel 值。
  orient?: string; // 图例列表的布局朝向。 'horizontal'  'vertical'
  padding?: number; // 图例内边距
  itemWidth?: number; // 图例标记的图形宽度
  itemHeight?: number; //  图例标记的图形高度
  top?: {
    type: string;
    value: string;
  };
  left?: {
    type: string;
    value: string;
  };
  right?: {
    type: string;
    value: string;
  };
  bottom?: {
    type: string;
    value: string;
  };
  textStyle: EchartTextStyleOption;
}


/**
 * 序列
 */
interface EchartSeriesOption {
  name?: string;
  radius?: number[];
  avoidLabelOverlap?: boolean; //防止标签重叠
  roseType?: string | boolean;
  selectedMode?: string | boolean;
  legendHoverLink?: boolean;
  selectedOffset?: number;
  startAngle?: number;
  minAngle?: number;
  minShowLabelAngle?: number;
  stillShowZeroSum?: boolean;
  zlevel?: number;
  cursor?: string;
  color?: string[];
  center?: Array<{ value: string; unit: string }>
  itemStyle?: EchartsSeriesItemStyleOption;
  label?: EchartsSeriesLabelOption;
  labelLine?: EchartsSeriesLabelLineOption;
  emphasis?: EchartsSeriesEmphasisOption;
  dataSource: DataSourceGroupType
}

export type {
  EchartTitleOption,
  EchartTooltipOption,
  EchartLegendOption,
  EchartTextStyleOption,
  EchartSeriesOption,
  EchartSeriesDataOption
};
